package phoenix.core.helpers;

import phoenix.core.PhoenixManager;
import phoenix.core.base.HelperBase;
import phoenix.web.page_objects.backend.*;


/**
 * Class provides methods for access to page objects (for Web sites)
 */

public class PageBackendHelper extends HelperBase
{
	// Page objects - backend
	private IndexPage indexPage;
	private SearchPage searchPage;
	private EditPage editPage;
	private PricePage pricePage;
	private NotificationSettingsPage notificationsSettingsPage;

	/**
	 * Initializes PageBackendHelper
	 * @param p_phoenix PhoenixManager instance
	 */
	public PageBackendHelper(PhoenixManager p_phoenix)
	{
		super(p_phoenix);
	}

	/**
	 * Index page (backend) instance
	 * @return BackendIndexPage instance
	 */
	public IndexPage indexPage()
	{
		if (indexPage == null)
		{
			indexPage = new IndexPage(phoenix);
		}
		return indexPage;
	}

	/**
	 * Search page (backend) instance
	 * @return BackendSearchPage instance
	 */
	public SearchPage searchPage()
	{
		if (searchPage == null)
		{
			searchPage = new SearchPage(phoenix);
		}
		return searchPage;
	}

	/**
	 * @return NotificationSettingsPage
	 */
	public NotificationSettingsPage notificationsSettingsPage()
	{
		if (notificationsSettingsPage == null)
		{
			notificationsSettingsPage = new NotificationSettingsPage(phoenix);
		}
		return notificationsSettingsPage;
	}

	/**
	 * UserMenu (backend) instance
	 * @return BackendUserMenu instance
	 */
	public UserMenu userMenu()
	{
		return new UserMenu(phoenix);
	}

	public EditPage editPage()
	{
		return new EditPage(phoenix);
	}

	public PricePage pricePage()
	{
		return new PricePage(phoenix);
	}

	public PhotosPage photosPage()
	{
		return new PhotosPage(phoenix);
	}

}
